VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "TestAutoTimer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Private mReport As Double
Private mTimer As AutoTimer

Public Sub testNoAction()
givenNewAutoTimer
thenNoActionBeforeDestruction
End Sub
Public Sub testAction()
givenNewAutoTimer
whenDestroyed
thenActionAfterDestruction
End Sub

''
''
''
Private Sub givenNewAutoTimer()
Set mTimer = New AutoTimer
mTimer.reportTo Me
End Sub
Private Sub whenDestroyed()
Set mTimer = Nothing
End Sub
Private Sub thenNoActionBeforeDestruction()
assert.equals mReport, -1, "NoActionBeforeDestruction"
End Sub
Private Sub thenActionAfterDestruction()
assert.isTrue mReport > 0, "ActionAfterDestruction"
End Sub
'OPTIONAL METHODS
Public Sub setup()
mReport = -1
End Sub
Public Sub teardown()
Set mTimer = Nothing
End Sub
Public Function NumOfAsserts() As Long
NumOfAsserts = 2
End Function

''
''
''
Public Sub reportTime(t As Double)
mReport = t
End Sub
